﻿using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace config2
{
    public class Test2Controller
    {
        private readonly IOptionsSnapshot<Log> optionsSnapshotConfig;

        public Test2Controller(IOptionsSnapshot<Log> optionsSnapshotConfig)
        {
            this.optionsSnapshotConfig = optionsSnapshotConfig;
        }

        public void test()
        {
            Console.WriteLine("Log节点：");
            Console.WriteLine(this.optionsSnapshotConfig.Value.level);
            Console.WriteLine("=======================================");
            Console.WriteLine(this.optionsSnapshotConfig.Value.type);
            Console.WriteLine("=======================================");
            Console.WriteLine(string.Join(',', this.optionsSnapshotConfig.Value.ids));
            Console.WriteLine("=======================================");
        }
    }
}
